/*
 * XML Type:  PaymentSyncRequest
 * Namespace: http://ofx.net/types/2003/04
 * Java type: net.ofx.types.x2003.x04.PaymentSyncRequest
 *
 * Automatically generated - do not modify.
 */
package net.ofx.types.x2003.x04.impl;
/**
 * An XML PaymentSyncRequest(@http://ofx.net/types/2003/04).
 *
 * This is a complex type.
 */
public class PaymentSyncRequestImpl extends net.ofx.types.x2003.x04.impl.AbstractSyncRequestImpl implements net.ofx.types.x2003.x04.PaymentSyncRequest
{
    
    public PaymentSyncRequestImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName BANKACCTFROM$0 = 
        new javax.xml.namespace.QName("", "BANKACCTFROM");
    private static final javax.xml.namespace.QName PMTTRNRQ$2 = 
        new javax.xml.namespace.QName("", "PMTTRNRQ");
    
    
    /**
     * Gets the "BANKACCTFROM" element
     */
    public net.ofx.types.x2003.x04.BankAccount getBANKACCTFROM()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.BankAccount target = null;
            target = (net.ofx.types.x2003.x04.BankAccount)get_store().find_element_user(BANKACCTFROM$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "BANKACCTFROM" element
     */
    public void setBANKACCTFROM(net.ofx.types.x2003.x04.BankAccount bankacctfrom)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.BankAccount target = null;
            target = (net.ofx.types.x2003.x04.BankAccount)get_store().find_element_user(BANKACCTFROM$0, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.BankAccount)get_store().add_element_user(BANKACCTFROM$0);
            }
            target.set(bankacctfrom);
        }
    }
    
    /**
     * Appends and returns a new empty "BANKACCTFROM" element
     */
    public net.ofx.types.x2003.x04.BankAccount addNewBANKACCTFROM()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.BankAccount target = null;
            target = (net.ofx.types.x2003.x04.BankAccount)get_store().add_element_user(BANKACCTFROM$0);
            return target;
        }
    }
    
    /**
     * Gets array of all "PMTTRNRQ" elements
     */
    public net.ofx.types.x2003.x04.PaymentTransactionRequest[] getPMTTRNRQArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(PMTTRNRQ$2, targetList);
            net.ofx.types.x2003.x04.PaymentTransactionRequest[] result = new net.ofx.types.x2003.x04.PaymentTransactionRequest[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "PMTTRNRQ" element
     */
    public net.ofx.types.x2003.x04.PaymentTransactionRequest getPMTTRNRQArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PaymentTransactionRequest target = null;
            target = (net.ofx.types.x2003.x04.PaymentTransactionRequest)get_store().find_element_user(PMTTRNRQ$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "PMTTRNRQ" element
     */
    public int sizeOfPMTTRNRQArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(PMTTRNRQ$2);
        }
    }
    
    /**
     * Sets array of all "PMTTRNRQ" element
     */
    public void setPMTTRNRQArray(net.ofx.types.x2003.x04.PaymentTransactionRequest[] pmttrnrqArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(pmttrnrqArray, PMTTRNRQ$2);
        }
    }
    
    /**
     * Sets ith "PMTTRNRQ" element
     */
    public void setPMTTRNRQArray(int i, net.ofx.types.x2003.x04.PaymentTransactionRequest pmttrnrq)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PaymentTransactionRequest target = null;
            target = (net.ofx.types.x2003.x04.PaymentTransactionRequest)get_store().find_element_user(PMTTRNRQ$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(pmttrnrq);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "PMTTRNRQ" element
     */
    public net.ofx.types.x2003.x04.PaymentTransactionRequest insertNewPMTTRNRQ(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PaymentTransactionRequest target = null;
            target = (net.ofx.types.x2003.x04.PaymentTransactionRequest)get_store().insert_element_user(PMTTRNRQ$2, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "PMTTRNRQ" element
     */
    public net.ofx.types.x2003.x04.PaymentTransactionRequest addNewPMTTRNRQ()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PaymentTransactionRequest target = null;
            target = (net.ofx.types.x2003.x04.PaymentTransactionRequest)get_store().add_element_user(PMTTRNRQ$2);
            return target;
        }
    }
    
    /**
     * Removes the ith "PMTTRNRQ" element
     */
    public void removePMTTRNRQ(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(PMTTRNRQ$2, i);
        }
    }
}
